Skip to content

ref(explore): Migrate replayQueryParamsProvider to nuqs#115422

Open
ryan953 wants to merge 1 commit into
masterfrom
ryan953/migrate-replay-query-params-nuqs
Open

ref(explore): Migrate replayQueryParamsProvider to nuqs#115422
ryan953 wants to merge 1 commit into
masterfrom
ryan953/migrate-replay-query-params-nuqs

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented May 12, 2026

Summary

  • Replaces the deprecated updateNullableLocation pattern with nuqs useQueryStates in the replay list query params provider
  • Removes dependencies on useLocation, useNavigate, getQueryFromLocation, and savedQuery helpers
  • Part of the broader effort to deprecate updateNullableLocation and migrate all callsites to nuqs

Test plan

  • Lint passes
  • Typecheck passes
  • Verify replay list page loads and search/query param updates work correctly

…cation to nuqs

Replace the deprecated updateNullableLocation pattern with nuqs
useQueryStates for managing URL query params in the replay list
provider. This removes dependencies on useLocation, useNavigate,
and manual Location object mutation.
@ryan953 ryan953 requested a review from a team as a code owner May 12, 2026 21:05
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 12, 2026
@ryan953 ryan953 requested review from a team May 12, 2026 21:05
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.50%

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4c98b10. Configure here.

const target = getTargetWithReadableQueryParams(location, writableQueryParams);
navigate(target);
setNuqsParams({
query: writableQueryParams.query ?? null,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined query coerced to null changes preservation semantics

Low Severity

The expression writableQueryParams.query ?? null collapses undefined into null. With the old updateNullableLocation, passing undefined was a no-op (the current query param was preserved), while null removed it from the URL. With nuqs, null also removes the param, and undefined leaves it as-is. The ?? null coercion means any caller passing a WritableQueryParams without a query field will now inadvertently clear the query from the URL instead of preserving it. No current replay component triggers this path, but it breaks the semantic contract of the old code.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4c98b10. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant